package day06;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/2/17
 **/
public class MethodDemo {
    public static void main(String[] args) {
        aMethod();
        System.out.println(444);


//        say();
//           sayHi("250", 20);
//          sayHi("张三",80);

//        sayHello("小明");
//        double a = getNum();
//        int b= plus(2,3);
//        System.out.println(a);
//        System.out.println(b);


        /*
        int[] a = testArray(25,2052);
        System.out.println("第一个元素是" + a[0]);
        int[] b = testArray(32,1032);
        System.out.println("数组长度为" + b.length);
        int[] c = testArray(78,78956);
        for (int i = 0; i < c.length; i++) {
            System.out.println(c[i]);
        }

         */


    }

    public static int[] testArray(int len, int max) {
        int[] arr = new int[len];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * (max + 1));
        }
        return arr;
    }

    public static void say() {
        System.out.println("1111");
    }

    public static void sayHi(String name, int age) {
        if (age > 50) {
            return;
        }
        System.out.println("我叫" + name + ",我" + age + "岁了");
    }

    public static void sayHello(String name) {
        System.out.println("我叫" + name + "今年0岁了");
    }

    public static double getNum() {
        return 8.8;
    }

    public static int plus(int num1, int num2) {
        int sum = num1 + num2;
        return sum;
    }

    public static void aMethod() {
        System.out.println(111);
        bMethod();
        System.out.println(222);
    }

    public static void bMethod() {
        System.out.println(333);
    }


}
